/**
 *@author: zhaosong 
 *@file: template test
 */

#include<iostream>
#include<max.hpp>

class A
{

};

const A reA()//返回一个自定义的类型时，会被视为左值
{
    A a;
    return a;
}
void show()
{
    std::cout<<"Gloabl show\n";
}

template<typename T>
class Base
{
public:
    void show()
    {
        std::cout<<"Base.show\n";
    }
};

template<typename T>
class Derived:public Base<T>
{
public:
    void foo()
    {
        show();  //调用Gloabl show
    }

    void foo2()
    {
        this->show();  //调用base show
    }

    void foo3()
    {
        Base<T>::show();  //调用Base show
    }
};

template<typename T, int n>
void test(T t)
{
    std::cout<<t<<", "<<n<<std::endl;
}



int main()
{
    int i=1;
    int j=2;
    std::cout<<max(i, j)<<std::endl;
    A b;
    // reA() = b;

    Derived<int> d;
    d.foo();
    d.foo2();
    d.foo3();

    test<float, 2>(1);
    return 0;
}